<template>
<div class="root-3d">
  <!-- <CesiumMap :options="cesiumOptions" /> -->
  <div class="three-root-wrapper">
    <ThreeScene :sceneName="sceneName" :contextOptions="threeOptions" />
  </div>
  <div class="router-view-wrapper">
    <!-- <HomeView /> -->
  </div>
</div>
</template>



<script setup>
// import CesiumMap from './components/cesium/CesiumMap.vue'
import ThreeScene from './components/three/ThreeScene.vue'
import { provide } from 'vue'
import { sceneName } from './views/three-scene/index.js'
import HomeView from './views/HomeView.vue'
import * as Cesium from 'cesium'
import './views/cesium-map/index-cesium-map.js'

const cesiumOptions = {
  contextOptions: {
    webgl: {
      alpha: true, // 启用透明度
    },
  },
  baseLayer: Cesium.ImageryLayer.fromWorldImagery(),
  // terrain: Cesium.Terrain.fromWorldTerrain(),
}

const threeOptions = {
  alpha: true,
  premultipliedAlpha: false,
}



const vueOptions = {
  seamlessScrollOption: {
    direction: 'top',
    steep: 0.0,
    distance: 20,
    // direction 	滚动的方向 	'top' | 'bottom' | 'left' | 'right' 	'top'
    // steep 	滚动的速率 	number 	0.5
    // roller 	是否可以使用滚轮滚动 	boolean 	true
    // distance 	滚轮滚动的速率 	number 	20
    // data 	接收异步数据，同步任务可不传
  },
  repositoryCount: 20,
}
Object.entries(vueOptions).forEach(([key, value]) => {
  provide(key, value)
})
if (import.meta.env.DEV) {
  // import.meta.env.MODE === 'development'
  // import('./temp-dev').then(({ default: de, f1, tempGetCoordinates, download, monitorCameraEvent }) => {
  //   // f1()
  //   // tempGetCoordinates()
  //   // download()
  //   // monitorCameraEvent()

  // })
}
</script>

<style lang="scss" scoped>
@use './assets/main.scss';

.root-3d {
  position: relative;
  width: 100%;
  height: 100%;
  color: #fff;
  // opacity: 1;
  --row-stripe-bg-color: rgba(255, 255, 255, 0.1);

  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    --scrollbar-width: 8px;

    ::-webkit-scrollbar-track {
      background-color: transparent;
    }

    ::-webkit-scrollbar-button {
      display: none;
    }

    ::-webkit-scrollbar {
      width: var(--scrollbar-width);
      background: transparent;
      border-radius: 6px;
      cursor: pointer;
    }

    ::-webkit-scrollbar-thumb {
      width: var(--scrollbar-width);
      min-height: 15px;
      background: rgba(45, 203, 255, 0.8) !important;
      border-radius: 6px;
      cursor: pointer;
    }
  }
}

.three-root-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  // pointer-events: none;
  // opacity: 0;


  :deep(canvas) {
    background-color: transparent;
  }
}

.router-view-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
</style>